package com.facexue.miniprogram.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import io.minio.MinioClient;
import lombok.Data;

@Data
@Configuration
@ConfigurationProperties(prefix = "spring.minio")
public class MinioConfig {
	private String accesskey;
	private String secretKey;
	private String url;
	private String bucketName;
	
	@Bean
	public MinioClient minioClient(){
		return MinioClient.builder().endpoint(url).credentials(accesskey, secretKey).build();
	}
}
